-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
Thanks for your contribution! |
@SigureMo 我尝试了一些方法获取到报错的关键信息,但是发现好像都不是很通用,现在这样是把所有错误信息的换行符替换成了\n显示在一行里。我想问下有没有什么好办法可以直接获取到单独的报错信息,因为err.args[0]已经被替换成了特殊的报错格式,很难在单独一行里面显示出来。 |
1778fbe
to
11bba14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SigureMo 我尝试了一些方法获取到报错的关键信息,但是发现好像都不是很通用,现在这样是把所有错误信息的换行符替换成了\n显示在一行里。我想问下有没有什么好办法可以直接获取到单独的报错信息,因为err.args[0]已经被替换成了特殊的报错格式,很难在单独一行里面显示出来。
这个我没有具体调研也不太清楚呀,不过这个任务比较自由,只要效果有提升就好了~
class IterVariable(VariableBase): | ||
""" | ||
This Variable (include subclasses) should be generated only when simulate GET_ITER opcode | ||
""" | ||
|
||
def __init__( | ||
self, obj: VariableBase, graph: FunctionGraph, tracker: Tracker | ||
self, obj: SizedVariable, graph: FunctionGraph, tracker: Tracker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SigureMo 可以看下现在的方案,如果是正常的 self.assertIs 已经可以支持在源码中显示具体的错误信息,但是像这种 1/0 的语法错误,由于还没有更合适的捕捉错误方法,暂时用的是正则匹配,错误信息很难捕捉到,使用了Error代替 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~我觉得效果已经挺不错了~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
fixes #243